﻿<!DOCTYPE html>
<!--  window-icon 弹出框图 例: window-icon="http://www.qt6.com/favicon.ico"    -->
<html lang="en" window-frame="solid" window-icon="./view/icon/server-favicon.ico"></html>
<head>
	<meta charset="UTF-8">
	<title>backstage</title>
    <link rel="stylesheet" type="text/css" href="./view/css/index.css">
    <style>
        #content {
            background: #0000;
        }
        
        #content button#yes,#content button#no{
            padding: 10px 20px;
            background: red;
            color: aqua;
        }
    </style>
</head>
<body id="body" role="window-caption">
    <div id="box" class="skinbg">   
        <div class="advertising">
            <div class="advertise">
                <span class="close">
                    还有5s
                </span>
                <button class="turnoff">关闭</button>
            </div>
        </div>
    </div>  
    <script type="text/tiscript" src="./view/tiscript/index.tis"></script>
    <script type="text/tiscript">

         self.ready = function() {
               moveToScreenCenter(932,612);
                //定时器 
               var cnt = 4;
                $(.close).timer(1000, function() {
                    this.text = "还有" + cnt+"s";
                    if(cnt <= 0) {
                        //返回false则停止定时器
                        view.load("./view/index.html",true)
                        return false;
                    }
                    cnt--;
                    return true;
                });

                 
                    // 关闭 
                    $(.turnoff).on("click",function(){
                            var userinfo = view.getuserinfo()

                            if(userinfo.level == "0"){
                                var argument = {
                                    "newin":view,
                                    "type":"hint",
                                    "title":"开通会员",
                                    "text":"请开通会员",
                                    "buttons":[{id:"close",text:"取消"},{id:"yes",text:"确认开通"}],
                                }
                                view.dialog({
                                    //加载到对话框中的URL，可加载本地文件
                                    url: "./view/popup.html",
                                    //对话框的x，y坐标
                                    x: 0,
                                    y: 0,
                                    //窗口的宽度，高度
                                    width: 272, 
                                    height: 170,
                                    //是否是客户区，如果为真，那么x，y，width，height作为客户区坐标，而不是窗口
                                    client: false,
                                    //对话框 参数
                                    parameters: argument,
                                    //对话框标题
                                    caption: "新对话框",
                                    //相对于屏幕窗口对齐
                                    alignment: 1,
                                });
                            }else{
                                view.load("./view/index.html",true)
                            }
                    })
        }
    
    </script>
</body>
</html>